<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>


<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>


<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>MODIFY LEAD</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<f:view>

			<h:inputHidden value="#{leadController.tempVarMLD}"></h:inputHidden>

			<h:form id="modifyLeadFormId" style=" width: 800px">

				<h:commandLink value="Log Out"
					action="#{authenticationController.logout}">
				</h:commandLink>

				<rich:spacer width="11"></rich:spacer>

				<h:commandLink value="Back to Dashboard"
					action="#{leadController.navigateToSalesAgentDashboard}"
					immediate="true">
				</h:commandLink>

				<rich:panel id="panel" header=" MODIFY LEAD DETAIL">

					<rich:messages globalOnly="true"></rich:messages>

					<table border="0" cellpadding="0" cellspacing="10" width="100%">

						<tr>
							<td width="25%" align="right">
								<h:outputLabel for="firstname" value="firstname"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>
							</td>
							<td width="75%" align="left">
								<h:inputText
									value="#{leadController.selectedLeadToModify.firstname}"
									id="firstname" label="firstname" required="true"
									requiredMessage=" Firstname is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
									<a4j:support id="firstName" event="onblur"
										reRender="fnameErrMsg" ajaxSingle="true" limitToList="true" />
								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

								<rich:message id="fnameErrMsg" for="firstname" passedLabel="*"
									style='color:red; font-size: 11px;' showDetail="false"
									showSummary="true"></rich:message>

							</td>


						</tr>

						<tr align="left">

							<td width="10%" align="right">
								<h:outputLabel for="lastname" value="lastname"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td width="60%">

								<h:inputText
									value="#{leadController.selectedLeadToModify.lastname}"
									id="lastname" label="lastname" required="true"
									requiredMessage=" Lastname is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

									<a4j:support id="lastName" event="onblur"
										reRender="lnameErrMsg" ajaxSingle="true" limitToList="true" />
								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

								<rich:message id="lnameErrMsg" for="lastname" passedLabel="*"
									style='color:red; font-size: 11px;' showDetail="false"
									showSummary="true"></rich:message>

							</td>

						</tr>

						<tr align="left">
							<td align="right">
								<h:outputLabel for="email" value="email"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td>
								<h:inputText
									value="#{leadController.selectedLeadToModify.email}" id="email"
									label="email"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>

						<tr align="right">
							<td>
								<h:outputLabel for="phone" value="phone"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="phone"
									value="#{leadController.selectedLeadToModify.phone}"
									label="phone"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>

						</tr>



						<tr align="right">
							<td>
								<h:outputLabel for="mobile" value="mobile"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="mobile"
									value="#{leadController.selectedLeadToModify.mobile}"
									label="mobile"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="title" value="title"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="title"
									value="#{leadController.selectedLeadToModify.title}"
									label="mobile"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>

						<tr align="right">
							<td>

								<h:outputLabel for="leadSource" value="lead source"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">

								<h:outputText
									value="#{leadController.selectedLeadToModify.leadsource}"
									id="leadSource"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
								</h:outputText>

								<rich:spacer width="5"></rich:spacer>

								<h:selectOneMenu id="leadSourceSelectOneMenu"
									value="#{leadController.selectedLeadToModify.leadsource}">
									<f:selectItems value="#{leadController.leadSourceSelectItems}" />
								</h:selectOneMenu>

							</td>

						</tr>


						<tr align="right">
							<td>

								<h:outputLabel for="industry" value="industry"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">

								<h:outputText
									value="#{leadController.selectedLeadToModify.industry}"
									id="industry"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
								</h:outputText>

								<rich:spacer width="5"></rich:spacer>

								<h:selectOneMenu id="industrySelectOneMenu"
									value="#{leadController.selectedLeadToModify.industry}">
									<f:selectItems value="#{leadController.industrySelectItems}" />
								</h:selectOneMenu>

							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="anualRevenue" value="annual revenue"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="anualRevenue"
									value="#{leadController.selectedLeadToModify.annualrevenue}"
									label="anualRevenue"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>


							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="compaignSource" value="campaign source"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="compaignSource"
									value="#{leadController.selectedLeadToModify.compaignsource}"
									label="compaignSource"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>


							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="companyName" value="company name"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="companyName"
									value="#{leadController.selectedLeadToModify.companyname}"
									label="companyName"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="fax" value="fax"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="fax"
									value="#{leadController.selectedLeadToModify.fax}" label="fax"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="website" value="website"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="website"
									value="#{leadController.selectedLeadToModify.website}"
									label="website"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>


						<tr align="right">
							<td>

								<h:outputLabel for="leadStatus" value="lead status"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">

								<h:outputText
									value="#{leadController.selectedLeadToModify.leadstatus}"
									id="leadStatus"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
								</h:outputText>

								<rich:spacer width="5"></rich:spacer>

								<h:selectOneMenu id="leadstatusSelectOneMenu"
									value="#{leadController.selectedLeadToModify.leadstatus}">
									<f:selectItems value="#{leadController.leadStatusSelectItems}" />
								</h:selectOneMenu>

							</td>

						</tr>


						<tr align="right">
							<td>
								<h:outputLabel for="numOfEmployees" value="number of employees"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="numOfEmployees"
									value="#{leadController.selectedLeadToModify.numberofemployees}"
									label="website"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>


							</td>

						</tr>

						<tr align="right">
							<td>

								<h:outputLabel for="rating" value="lead rating"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">

								<h:outputText
									value="#{leadController.selectedLeadToModify.rating}"
									id="rating"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
								</h:outputText>

								<rich:spacer width="5"></rich:spacer>
								
								<h:selectOneMenu id="ratingSelectOneMenu"
									value="#{leadController.selectedLeadToModify.rating}">
									<f:selectItems value="#{leadController.leadRatingSelectItems}" />
								</h:selectOneMenu>

							</td>

						</tr>

						<tr align="right">
							<td>
								<h:outputLabel for="liveID" value="liveID"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">
								<h:inputText id="liveID"
									value="#{leadController.selectedLeadToModify.liveid}"
									label="liveID"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>



							</td>

						</tr>


						<tr align="right">
							<td>

								<h:outputLabel for="street" value="street"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>

							<td align="left">

								<h:inputText id="street"
									value="#{leadController.selectedLeadToModify.street}"
									label="street" required="true"
									requiredMessage=" Street address is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">
								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>



						<tr align="left">
							<td align="right">
								<h:outputLabel for="city" value="city"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

								<rich:spacer width="9"></rich:spacer>

							</td>

							<td align="left">
								<h:inputText value="#{leadController.selectedLeadToModify.city}"
									id="city" required="true" requiredMessage=" City is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>


						<tr align="left">
							<td align="right">
								<h:outputLabel for="zipcode" value="zip code"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

								<rich:spacer width="9"></rich:spacer>

							</td>

							<td align="left">
								<h:inputText
									value="#{leadController.selectedLeadToModify.zipcode}"
									id="zipcode"
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>


						<tr align="left">
							<td align="right">
								<h:outputLabel for="state" value="state"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

								<rich:spacer width="9"></rich:spacer>

							</td>

							<td align="left">
								<h:inputText
									value="#{leadController.selectedLeadToModify.state}" id="state"
									required="true" requiredMessage=" State is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>


						<tr align="left">
							<td align="right">
								<h:outputLabel for="country" value="country"
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

								<rich:spacer width="9"></rich:spacer>

							</td>

							<td align="left">
								<h:inputText
									value="#{leadController.selectedLeadToModify.country}"
									id="country" required="true"
									requiredMessage=" Country is required."
									style="background-position: left; background-color: WhiteSmoke; height: 20px; width: 150px; border-right-color: AntiqueWhite; border-bottom-color: AntiqueWhite; border-top-color: AntiqueWhite; border-left-color: AntiqueWhite; cursor: text">

								</h:inputText>

								<rich:spacer width="5"></rich:spacer>

							</td>
						</tr>



						<tr align="left">
							<td>
							</td>

							<td align="left">

								<a4j:commandButton style="width: 108px"
									action="#{leadController.modifyLead}" value="Modify"
									reRender="finalMsg">
								</a4j:commandButton>

							</td>


						</tr>


					</table>
					<table>
						<tr align="left">

							<td width="100%">
								<h:outputLabel id="finalMsg" value=""
									style='font-family: Georgia, "Times New Roman", Serif; font-size: 11px; color: SteelBlue'></h:outputLabel>

							</td>
						</tr>
					</table>
				</rich:panel>
			</h:form>


		</f:view>
	</body>
</html>